import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

import Index from '@/components/Index'
import Regist from '@/components/Regist'
import Login from '@/components/login'
import Menus from '@/components/index/Menus'
import Users from '@/components/index/Users'
import Classes from '@/components/index/Classes'
import Outlines from '@/components/index/Outlines'
import Items from '@/components/index/Items'
import Papers from '@/components/index/Papers'
import PapersAdd from '@/components/index/PapersAdd'
import PapersList from '@/components/index/PapersList'
import PapersEdit from '@/components/index/PapersEdit'
import Publish from '@/components/Publish.vue'
import Thanks from '@/components/Thanks.vue'
import Count from '@/components/index/Count.vue'
import UserCenter from '@/components/index/UserCenter.vue'
export default new Router({
    routes: [
        {
            path:'/',
            redirect:'/index/users'
        },
        {
            path:'/publish/:paper_id',
            name:'publish',
            props:true,
            component:Publish
        },
        {
            path:'/thanks',
            name:'thanks',
            props:true,
            component:Thanks
        },
        {
            path:'/index',
            name:'index',
            redirect:'/index/users',
            component:Index,
            children:[
                {
                    path:'menus',
                    component:Menus
                },
                {
                    path:'users',
                    component:Users
                },
                {
                    path:'outlines',
                    component:Outlines
                },
                {
                    path: 'classes',
                    component: Classes
                },
                {
                    path:'items',
                    component:Items
                },
                {
                    path:'count/:paper_id',
                    component:Count,
                    name:'count',
                    props:true
                },
                {
                    path:'UserCenter',
                    component:UserCenter,
                    name:'UserCenter',
                    props:true
                },
                {
                    path:'papers',
                    redirect:'/index/papers/list',
                    components:Papers,
                    chilidren:[
                        {
                            path:'list',
                            component:{
                                templete:'<div>list</div>'
                            }
                        },
                        {
                            path:'add',
                            component:{
                                templete:'<div>hello</div>'
                            }
                        },
                    ]
                },
                {
                    path:'papers/add',
                    name:'papersAdd',
                    component:PapersAdd
                },
                {
                    path:'papers/list',
                    name:'paperlist',
                    component:PapersList
                },
                {
                    path:'papers/edit/:id',
                    props:true,
                    name:'papersedit',
                    component:PapersEdit
                }
            ]
        },
        {
            path:'/login',
            name:'login',
            component:Login
        },
        {
            path:'/regist',
            name:'regist',
            component:Regist
        }
    ]
})
